cmake_minimum_required(VERSION 3.1)

project(sedgewick-cpp)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

option(USE_CCACHE "Use ccache if available" ON)
if(USE_CCACHE)
  find_program(CCACHE_PROGRAM ccache)
  if(CCACHE_PROGRAM)
    set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
  endif()
endif()

include(CTest)

add_definitions(-ggdb3)
add_definitions(-Wall)
add_definitions(-Wextra)
add_definitions(-std=c++14)

include_directories(include)
include_directories(src)
include_directories(thirdparty)

configure_file(scripts/utils.sh scripts/utils.sh COPYONLY)

add_subdirectory(src)
add_subdirectory(thirdparty)
